package soccerBet.project.utils;

import java.util.List;

import soccerBet.project.dao.EquipasDAO;
import soccerBet.project.objects.Classificacao;

public class BuildText {

	public static String buildClassificacao(List<Classificacao> classList) {
		
		EquipasDAO equipaDAO = new EquipasDAO();
		String text ="";
		
		text +="<table border=\"1\">";
		text +="<tr>";
		text +="<td>Equipa</td>";
		text +="<td>J</td>";
		text +="<td>GMC</td>";
		text +="<td>GSC</td>";
		text +="<td>GMF</td>";
		text +="<td>GSF</td>";
		text +="<td>P</td>";
		text +="</tr>"; 
		
		
		for(int i=0;i<classList.size();i++){
			text+="<tr>"+"<td>"+equipaDAO.getEquipa(classList.get(i).getEquipa().getIdEquipa()).getNome()+"</td><td>"+(classList.get(i).getJogosCasa()+classList.get(i).getJogosFora())+"</td><td>"+classList.get(i).getGolosMarcadosCasa()+"</td><td>"+classList.get(i).getGolosSofridosCasa()+"</td><td>"
			+classList.get(i).getGolosMarcadosFora()+"</td><td>"+classList.get(i).getGolosSofridosFora()+"</td><td>"+classList.get(i).getPontos()+"</td></tr>";
		}
		
		return text+"</table><br/><br/>";
	}

}
